# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Contributor: Krassy Boykinov <kboykinov@teamcentrixx.com>
maintainer="Krassy Boykinov <kboykinov@teamcentrixx.com>"
pkgname=libusbmuxd
pkgver=2.1.0
pkgrel=0
pkgdesc="USB Multiplex Daemon"
url="https://libimobiledevice.org"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	autoconf
	automake
	libimobiledevice-glue-dev
	libplist-dev
	libtool
	libusb-dev
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-progs"
source="$pkgname-$pkgver.tar.gz::https://github.com/libimobiledevice/libusbmuxd/archive/refs/tags/$pkgver.tar.gz"

prepare() {
	default_prepare
	NOCONFIGURE=1 ./autogen.sh

	# autogen.sh does not generate PACKAGE_VERSION in configure, something seems wrong with git-version-gen
	sed -i -e "s/PACKAGE_VERSION=''/PACKAGE_VERSION='$pkgver'/" configure
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--disable-static \
		--prefix=/usr
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

progs() {
	pkgdesc="$pkgdesc - utilities"
	amove usr/bin
}

sha512sums="
286f4f2c0519ae1e4b97a8c7c16d617278256436d980d6238edc494774e8b3cfcb1df0aa3bcfa95cff25e738242cc1105e96a7f9353d9a628faed1c606b753f0  libusbmuxd-2.1.0.tar.gz
"
